<template>
    <div>
        <h1>登录</h1>

        <button @click="login">登录</button>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';

let token = ref('123456789')
let route = useRoute()
let router = useRouter()

function login(){
    localStorage.setItem('token',token.value)
    router.push({
        path:'/home'
    })
}


</script>

<style lang="scss" scoped></style>